package com.ruoyi.common.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 阿里云短信常量
 */
public class AliYunSmsConstants {

    @AllArgsConstructor
    @Getter
    public enum TemplateEnum {
        /**
         * 后台赠送实物
         * 推广短信
         * 为了感谢您对本加油站的支持，赠送您一份精品大礼包，请到店领取使用谢谢。地址:费县新庄镇公路站对过(518国道与231省道交汇处)。回T退订
         */
        RECHANGE("giftReceive", "SMS_269220371", "为了感谢您对本加油站的支持，赠送您一份精品大礼包，请到店领取使用谢谢。地址:费县新庄镇公路站对过(518国道与231省道交汇处)。回T退订"),


        NULL("", "", ""),
        ;
        private String code;
        private String aliCode;
        private String templateText;

        public static AliYunSmsConstants.TemplateEnum match(String code) {
            for (AliYunSmsConstants.TemplateEnum one : AliYunSmsConstants.TemplateEnum.values()) {
                if (one.getCode().equalsIgnoreCase(code)) {
                    return one;
                }
            }
            return AliYunSmsConstants.TemplateEnum.NULL;
        }

    }

    @AllArgsConstructor
    @Getter
    public enum SignEnum {
        DEFAULT(0, "阜鑫渔港加油站"),
        ;
        private int shopId;
        private String sign;

        public static String match(Long shopId) {
            for (AliYunSmsConstants.SignEnum one : AliYunSmsConstants.SignEnum.values()) {
                if (one.getShopId() == shopId) {
                    return one.getSign();
                }
            }
            return AliYunSmsConstants.SignEnum.DEFAULT.getSign();
        }

    }
}
